package vip.xumy.admin.sys.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

import vip.xumy.admin.sys.pojo.ActionLog;
import vip.xumy.admin.sys.service.LogService;
import vip.xumy.core.pojo.com.PageResponse;

/**
 * @author:mengyxu
 * @date:2019年12月5日
 */

@RestController
@RequestMapping("admin")
public class LogController {
	@Autowired
	private LogService LogService;

	@RequestMapping(value = "log/action", method = RequestMethod.GET)
	public PageResponse<ActionLog> queryActionLogList(ActionLog example) {
		Page<ActionLog> pages = PageHelper.startPage(example.getPage(), example.getSize());
		List<ActionLog> list = LogService.queryActionLog(example);
		PageResponse<ActionLog> rsp = new PageResponse<>();
		rsp.setRows(list);
		rsp.setTotal(pages.getTotal());
		return rsp;
	}

}
